// @Author EthanScriptOn
// @Desc
package pool

import (
	"fmt"
)

// PanicRejectStrategy Rejection policy when the task cannot be processed -panic
type PanicRejectStrategy struct {
}

func GeneratePanicRejectStrategy() *PanicRejectStrategy {
	return new(PanicRejectStrategy)
}

func (p *PanicRejectStrategy) Reject(task Task, workerPool *WorkerPool) {
	panic(fmt.Errorf("the %v task cannot be executed correctly ", task))
}
